package se.webbzon.boltzmann.battle.battleaction;

import java.util.Collection;
import java.util.List;

import se.webbzon.boltzmann.battle.group.BattleGroup;
import se.webbzon.boltzmann.battle.object.npc.BattleNPC;
import se.webbzon.oschi01.worldarea.WorldArea;

public abstract class BattleActionFactory {
	
	// An optional icon of this battle action factory
	private final BattleActionFactoryIcon icon;
	
	/*============================================================
	Constructors
	============================================================*/
	
	public BattleActionFactory() {
		this(null);
	}
	
	public BattleActionFactory(BattleActionFactoryIcon icon) {
		this.icon = icon;
	}
	
	/*============================================================
	Public Methods
	============================================================*/
	
	/** Returns true if this battle action factory has a description icon. **/
	public boolean hasIcon() {
		return icon != null;
	}
	
	/** Returns the battle action factory icon of this battle action factory.
	 * If the battle action factory has no icon then null is returned. **/
	public BattleActionFactoryIcon getIcon() {
		return icon;
	}
	
	/** Returns the number of combinations that can be targeted by the
	 * action of this factory. **/
	public abstract int targets(Collection<BattleGroup> all, BattleNPC caster);
	
	/** Returns the (n+1):th target that can be chosen from this factory. **/
	public abstract List<BattleNPC> getTarget(	Collection<BattleGroup> all, 
												BattleNPC caster, int n);
	
	/** Creates a new battle action. **/
	public abstract BattleAction makeBattleAction(	WorldArea world,
													BattleNPC caster, 
													List<BattleNPC> targets);

}
